package com.han.hotelplat.service.task;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.alibaba.fastjson.JSONArray;
import com.han.hotelplat.comm.base.Pager;
import com.han.hotelplat.pojo.task.Task;

public interface TaskService {
	/**
	 * 
		 * @description	 查找某个时间段/或指定距离内的任务
		 * @author  han1088
		 * @param startDate 起始时间
		 * @param endDate 终止时间
		 * @param range 距离
		 * @param star 星级
		 * @param welfare 福利
		 * @param userlocation 用户定位
		 * @return
	 */
	public List<Task> getTask(Date startDate, Date endDate, Integer range,
			Integer star, List<Integer> welfare, String userlocation);
	
	/**
	 * 
		 * @description	查询对应酒店发布的任务
		 * @author  han1088
		 * @param hotelId 酒店ID
		 * @param state 状态
	 * @param wait 
		 * @return
	 */
	public List<Task> getHotelTask(Integer hotelId, Integer state, Integer wait);
	
	/**
	 * 
		 * @description	保存任务
		 * @author  han1088
		 * @param task
		 * @return
	 */
	public Task saveTask(Task task);

	/**
	 * 
		 * @description	发布任务
		 * @author  han1088
		 * @param request Task对象
		 * @return
	 */
	public Map<String, Object> publicTask(Task task, Integer userType);

	public List<Task> getEmTaskList(String userid, Integer state, Integer waittask);

	public Task getHotelTaskDteail(String taskid);

	public Map<String, Object> cancerTaskByHotel(String taskid, String cancercause, String canceruser);

	public void updateTask(Task t);
	
	/**
	 * 
		 * @description	
		 * @author  han1088
		 * @param hotelId
		 * @param startTime
		 * @param endTime
		 * @param pageNo
		 * @param areaCode
		 * @return
	 */
	public Pager<Task> getHotelTaskByPage(Integer hotelId, Date startTime, Date endTime, Integer pageNo,Integer areaCode);

	
	/**
	 * 
		 * @description	查询对应酒店发布的任务
		 * @author  han1088
		 * @param hotelId 酒店ID
		 * @param state 状态
		 * @return
	 */
	public List<Task> getHotelTask(Integer hotelId, Integer state, Date startTime, Date endTime);

	/**
	 * 
		 * @description	后台管理员取消帮工任务
		 * @author  han1088
		 * @param emid
		 * @param taskid
		 * @param remark
		 * @param constraint
		 * @return
	 */
	public Map<String, Object> cancerEmTaskByManager(String emid, String taskid,
			String remark, Integer constraint);

	public Task getEmployeeTaskDteail(String taskid, String userid);

	public Map<String, Object> cancerEmTaskByEm(String emid, String taskid,
			String cancercause);

	public Pager<Task> findHotelTaskByPage(String startDate, String endDate,
			Integer state, Integer areaCode, String condition, Integer pageNo,
			String emInfo);

	public void update(Task t);

	public Map<String, Object> stopTaskByHotel(String taskid, String cancercause, Integer constraint, String realname);
	
	/**
	 * 
		 * @description	管理员查询订单详情
		 * @author  han1088
		 * @param taskid
		 * @return
	 */
	public Task getHotelTaskDteailForManager(String taskid);
	
	public List<Task> exportHotelTask(String startDate, String endDate,
			Integer state, Integer areaCode, String condition);
	
	public Task getTaskById(Integer taskId);

	public Map<String, Integer> getTaskCount();

	public JSONArray getRoomCountGroupRoomType(String taskId);

	public void updateTaskState(String taskId, int state);
	
	public int getAuthEmAttendance(String userid,Task task);

	public Task findTaskByTaskid(String taskid);
}
